#light
namespace PresFirst
open System

type IFibModel =
    abstract Calculate : int -> int

type IFibView =
    abstract Title : string with set, get
    abstract NumberToCalculate : string with get
    abstract DisplayResult : string -> unit
    abstract Calculating : IEvent<EventArgs> with get

type FibPresenter(model: IFibModel, view: IFibView) =
    do view.Title <- "title"
    do view.Calculating.Add
        (fun _ ->
            view.NumberToCalculate
            |> Int32.of_string
            |> model.Calculate
            |> Int32.to_string
            |> view.DisplayResult)
